package com.OrderingSystem.service.impl;

import com.OrderingSystem.pojo.OrderDetail;
import com.OrderingSystem.mapper.OrderDetailMapper;
import com.OrderingSystem.service.IOrderDetailService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Chenlin
 * @since 2025-08-13
 */
@Service
public class OrderDetailServiceImpl extends ServiceImpl<OrderDetailMapper, OrderDetail> implements IOrderDetailService {

    @Autowired
    OrderDetailMapper orderDetailMapper;

    @Override
    public List<OrderDetail> selectOrderDetailByOrderId(Integer orderId) {
        QueryWrapper<OrderDetail> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("order_id", orderId);
        return orderDetailMapper.selectList(queryWrapper);
    }
}
